<?php
	include("operations\logout-result.php");	
	include 'handle/approve-handle.php';
	session_start();
	$id = $_GET['id'];
	$type = $_GET['type'];
	$action = $_GET['action'];
	
	if(!isset($_SESSION['user']))
	{
		header( 'Location: login.php' );
	}
	else 
	{		
		$username = $_SESSION['fullname'];
		$id_employee = $_SESSION['IDEmployee'];
	}
	function getlang(){
		$lang = $_SESSION['lang'];
		if (empty($lang) || $lang == "EN") {
			$value = "value/value_en.php";
		} else if($lang == "VN") {
			$value = "value/value_vn.php";
		}
		else {
			$value = "value/value_kr.php";
		}
		return $value;
	}
	$value = getlang();
	include($value);
	
	if($type==7)
	{
		$title = "Form 7";
		$content =  'content/view-form7-content.php';
	}
	else if ($type==12)
	{
		$title = "Form 12";
		$content =  'content/view-form12-content.php';
	}
	else if ($type==13)
	{
		$title = "Form 13";
		$content =  'content/view-form13-content.php';
	}
	else if ($type==15)
	{
		$title = "Form 15";
		$content = 'content/view-form15-content.php';
	}
	else if ($type ==14)
	{
		$title = "Form 14";
		$content =  'content/view-form14-content.php';
	}
	else if ($type ==16)
	{		
		$title = "Form 16";
		$content =  'content/view-form16-content.php';
	}
	else if ($type ==17)
	{
		$title = "Form 17";
		$content =  'content/view-form17-content.php';
	}
	if($_SESSION['action']=="my_declined" || $_SESSION['action']=="my_approved"){
			mysql_query("UPDATE approvedoc SET isView='1' WHERE (IDApproveDoc='$id')");
		}
	if($_SESSION['action']=="re_not_approve"){
		mysql_query("UPDATE listapprove SET isView='1' WHERE (IDGroupApprove=(SELECT a.IDGroupApprove FROM approvedoc a WHERE a.IDApproveDoc='$id'));");
	}
	//$_SESSION['lastpage'] = $url;
	
	require("templateMobile.php");
?>